package br.com.rybena;






import android.app.Activity;
import android.graphics.drawable.AnimationDrawable;
import android.os.Bundle;
/***
 * Classe Principal que extende uma Atividade
 * @author carlosrgomes
 *
 */
public class HelloWorldActivity extends Activity {
    /** Called when the activity is first created. */
	
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
       
    }
    
    @Override
    public void onWindowFocusChanged(boolean hasFocus) {
        AnimationDrawable hello = (AnimationDrawable) findViewById(R.id.hello).getBackground();
        AnimationDrawable world = (AnimationDrawable) findViewById(R.id.world).getBackground();

        if (hasFocus) {
        	hello.start();
        	world.start();
        } else {
        	hello.stop();
        	world.stop();
        }
    }
   
}